#include<iostream>
#include<map>
using namespace std;

map<string, string> database;

bool insert(string key, string value);
string select(string key);
void printAll();
bool deleteValue(string key);
void deleteAll();

int main(){
	int t;
	string key, value;
	while(true){
		cin>>t;
		if(t == 0){
			cin>>key;
			cin>>value;
			if(insert(key, value)) cout<<"insert succeed"<<endl;
			else cout<<"insert failed"<<endl;
		}else if(t == 1){
			cin>>key;
			cout<<select(key)<<endl;
		}else if(t == 2){
			printAll();
		}else if(t == 3){
			cin>>key;
			if(deleteValue(key)) cout<<"delete succeed"<<endl;
			else cout<<"delete failed"<<endl;
		}else if(t == 4){
			deleteAll();
		}else break;
	}
	return 0;
}

bool insert(string key, string value){
	if(database.count(key) == 0){
		database[key] = value;
		return true;
	}else{
		return false;
	}
}
string select(string key){
	if(database.count(key)){
		return database[key];
	}
	return "select failed";
}
void printAll(){
	bool flag = false;
	for(auto i:database){
		flag = true;
		cout<<i.first<<" "<<i.second<<endl;
	}
	if(!flag) cout<<"empty"<<endl;
}
bool deleteValue(string key){
	if(database.count(key)){
		database.erase(key);
		return true;
	}
	return false;
}
void deleteAll(){
	cout<<"delete succeed"<<endl;
	database.clear();
}
